#pragma once
#include <sfml/System.hpp>
#include <sfml/Window.hpp>
#include <sfml/Graphics.hpp>

#define GLEW_STATIC
#include <gl/glew.h>

#include <stdio.h>
#include <iostream>
#include <vector>

class GameState;

class GameEngine
{
public:
	GameEngine(void);
	~GameEngine(void);

	void Init(const char* sTitle,int width = 1280,int height = 720,bool fullscreen = false);
	void Cleanup();


	void ChangeState(GameState* state);
	void PushState(GameState* state);
	void PopState();

	void HandleEvents();
	void Update();
	void Draw();


	bool Running() {return bRunning;};
	void Quit() 
	{
		_Window.Close();
		bRunning = false;
	}

	unsigned int _Width,_Height;
	sf::RenderWindow _Window;
	sf::Clock _Time;


private:
	std::vector<GameState*> states;
	bool bRunning;
	bool bFullscreen;
	bool bFocused;


};

